package com.example.twoscroolview.activity

import SlideCardLayoutManager
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.viewpager.widget.ViewPager
import androidx.viewpager2.widget.ViewPager2
import com.example.twoscroolview.R
import com.example.twoscroolview.adapter.SlideAdapter
import com.example.twoscroolview.bean.StartBean
import com.example.twoscroolview.utils.SlideCardCallBack
import kotlinx.android.synthetic.main.activity_slide.*

class SlideCardActivity :AppCompatActivity(){
    val callBack by lazy {
        SlideCardCallBack(recycleView,adapter)
    }
    val adapter by lazy {
        SlideAdapter()

    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_slide)
        val list = mutableListOf<StartBean>()
        for (i in 0 until  10000){
            list.add(StartBean("$i","123"))
        }
        adapter.addData(list)
        recycleView.layoutManager= SlideCardLayoutManager()
        recycleView.adapter = adapter

        val itemTouchHelper = ItemTouchHelper(callBack)
        itemTouchHelper.attachToRecyclerView(recycleView)
    }
}